package net.wang.cloud.ticket.web;


import net.wang.cloud.dto.OrderDTO;
import net.wang.cloud.ticket.domain.Ticket;
import net.wang.cloud.ticket.service.TicketService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "api/ticket")
public class TicketController {

    @Resource
    private TicketService ticketService;

    @PostMapping(value = "/lock")
    public Ticket lock(@RequestBody OrderDTO orderDTO) {
        return ticketService.lockTicket(orderDTO);
    }

}